package com.yantong.mapper;

import com.yantong.pojo.CentreAmount;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

public interface CentreAmountMapper {

    /**
     * 新增商户账户
     * @param amount
     * @return
     */
    int addAmount(CentreAmount amount);
    
    
    /**
     * 新增商户账户
     * @param amount
     * @return
     */
    int save(CentreAmount amount);

    /**
     * 获取商户账户详情
     * @param centreId
     * @return
     */
    CentreAmount getByKey(Long centreId);

    /**
     * 更新商户账户信息
     * @param centreAmount
     * @return
     */
    int updateAmount(CentreAmount centreAmount);

    /**
     * 更新账户信息
     * @param centreAmount
     * @return
     */
    int changeAmount(CentreAmount centreAmount);

    /**
     * 扣除商户余额
     * @param centreId
     * @param amount
     * @return
     */
    int deductAmount(@Param("centreId") Long centreId, @Param("amount") BigDecimal amount);


}
